<?
$pag = new Paginator;
$info_set = $pag->Paginate("SELECT * FROM filebin_files WHERE status = 'public' AND (tags LIKE '%".$loc->db_cmp($_GET['query'])."%' OR filename LIKE '%".$loc->db_cmp($_GET['query'])."%' OR type LIKE '%".$loc->db_cmp($_GET['query'])."%' OR album LIKE '%".$loc->db_cmp($_GET['query'])."%') ORDER BY DATE DESC" , "pages" , " , " , "to" , PER_PAGE , "20" , 

"<div style='position:absolute; border:0px dashed red; padding:2px; top:1px; width:28px; height:30px; left:-110; z-index:9002;'><img style='border-width:0px;' src='images/previous.gif' /></div>" , 

"<div style='position:absolute; top:5px; left:555px; padding:2px; border:0px dashed black; color:white; z-index:9002;'><img style='border-width:0px;' src='images/next.gif' /></div>");

$num_rows = $info_set['num_rows'];
echo "<div id='records_wrapper' style='position:relative; top:10px;'>";
echo "<div style='position:absolute; top:20px; left:130px; z-index:2;'>" . $info_set['nav_links'] . "</div>";
echo "<div id='files_wrapper' style='position:relative; top:95px; left:0px;'>";

//Debug mode: Have a zombie user logged in for testing sakes.
$_SESSION['uid'] = 2;

$left = 0;
$top = 0;
$allimgs = 0;
$are_per_row = 0;
for ($i = 0; $i < $num_rows; $i++) {

	$selUser = mysql_query("SELECT id,user_name FROM filebin_users WHERE id = '".$loc->db_cmp($pag->setRow("uid" , $i))."'");
	$resUser = mysql_fetch_array($selUser);

	$uploaded_by = $loc->db_out($resUser['user_name']);

	$thumb_size = THUMB_SIZE;

	$typeArr = explode("/" , $loc->db_out($pag->setRow("type" , $i)));

	$rim = THUMBS_DIR . $loc->db_out($pag->setRow("filecode" , $i)) . ".jpg";
	$bigRim = TEMP_THUMBS_DIR . $loc->db_out($pag->setRow("filecode" , $i)) . ".jpg";
	$bigImgDat = @getimagesize($bigRim);
	$imgDat = @getimagesize($rim);

	if($are_per_row >= PER_ROW){$are_per_row=0; $left = 0; $top = $top+$thumb_size+65; }


	//Some session lookup
	if(!$_SESSION['uid'] || $_SESSION['uid']!= $resUser['id']){
		$email_left="3";
		$thumbs_up_left="19";
		$thumbs_down_left="35";
		$disp = "none";
	}else{
		$email_left="33";
		$thumbs_up_left="49";
		$thumbs_down_left="65";
		$disp = "block";
	}

	
	if($typeArr[0] == "image" && $typeArr[1] != "psd" && $typeArr[1] != "eps" && $imgDat != false){

		
		
		$topDownload = $top;
		$maxWidthForDownload = $bigImgDat[0]-130;
		?>
		<!-- Download information -->
		<div id="<?=$loc->db_out($pag->setRow("filecode" , $i));?>_download_info" style="position:absolute; padding:2px; display:none; z-index:1000; border:1px dashed black; background:yellow; color:black; font-family:tahoma; font-weight:bold; font-size:12px; left:0px; top:<?=$topDownload?>px; width:800px;">

			<span onClick="window.open('<?=WEB_ROOT . "download.php?type=temp_thumb&filecode=".$loc->db_out($pag->setRow("filecode" , $i))?>','<?=$loc->db_out($pag->setRow("filecode" , $i))?>','width=<?=$bigImgDat[0]+35?>,height=<?=$bigImgDat[1]+35?>,status=no,toolbar=no,location=yes,menubar=no,directories=no,resizable=yes,scrollbars=yes');" style="cursor:pointer;">Download URL: </span>
			<input
			name="download_url" 
			id="download_url" 
			type="text" readonly 
			style="border:0px solid green; font-family:tahoma; background:yellow; color:black; font-size:12px; width:680px;" 
			value="<?=WEB_ROOT . "download.php?type=temp_thumb&filecode=".$loc->db_out($pag->setRow("filecode" , $i))?>" />

			<div style="position:absolute; top:3px; cursor:pointer; left:784px;" onClick="window.open('<?=WEB_ROOT . "download.php?type=temp_thumb&filecode=".$loc->db_out($pag->setRow("filecode" , $i))?>','<?=$loc->db_out($pag->setRow("filecode" , $i))?>','width=<?=$bigImgDat[0]+35?>,height=<?=$bigImgDat[1]+35?>,status=no,toolbar=no,location=yes,menubar=no,directories=no,resizable=yes,scrollbars=yes');"><img src="images/go.gif" / ></div>

		</div>

		<!-- positioner of image -->
		<?if($bigImgDat[1] != 600){$heightThis = $bigImgDat[1];}else{$heightThis = 600;} if($bigImgDat[0] != 800){$widthThis = $bigImgDat[0];}else{$widthThis = 800;}?>
		<div id="<?=$loc->db_out($pag->setRow("filecode" , $i));?>" 
		style="position:absolute; width:<?=$widthThis?>px; height:<?=$heightThis?>px; display:none; z-index:10; background:white; border:1px solid red; left:0px; top:<?=$top?>px; cursor:pointer;" 
		onClick="document.getElementById('<?=$loc->db_out($pag->setRow("filecode" , $i))?>').innerHTML = ''; document.getElementById('<?=$loc->db_out($pag->setRow("filecode" , $i))?>').style.display='none'; document.getElementById('<?=$loc->db_out($pag->setRow("filecode" , $i))?>_download_info').style.display='none';"></div>

		<span style="position:absolute; z-index:10; border:0px solid red; left:0px; top:<?=$top?>px; cursor:pointer;" id="here_<?=$loc->db_out($pag->setRow("filecode" , $i));?>"></span>


		<!-- Image Info -->
		<div id='<?=$loc->db_out($pag->setRow("filecode" , $i));?>_info' 
		style="position:absolute; padding:5px; left:<?php $thisLeft = $left+$imgDat[0]; echo $thisLeft+((120-$imgDat[0])/2);?>px; top:<?=$top?>px; width:230px; display:none; background:white; color:#000046; z-index:700; font-family:verdana; font-size:10px; border:1px dashed black;">
		<?include "image_info.php";?>

		</div>

		
		<?
		if($imgDat[0] < 120){$thisLeftHere=$left+((120-$imgDat[0])/2);}else{$thisLeftHere = $left;}
		if($imgDat[1] < 120){$thisTopHere=$top+((120-$imgDat[1])/2);}else{$thisTopHere = $top;}
		?>

		<!-- The below icons only appear if a user is loged in and if the current image belongs to him. -->

		<!-- Icons for delete, tag, email, check -->
		<?if($left == 0){$hereThisOneLeft = 0;}else{$hereThisOneLeft = $left-5;}?>
		<div id="<?=$loc->db_out($pag->setRow("filecode" , $i));?>_image_holder" style="position:absolute; left:<?=$hereThisOneLeft?>px; top:<?=$thisTopHere-23?>px; border:1px dashed black; width:<?=$thumb_size+12?>px; height:<?=$imgDat[1]+37+6;?>px;">


			<!-- The rating graph -->
					
			<?			
			$maximumul = $loc->db_out($pag->setRow("total_rates" , $i)); //Get this from DB record
			$rat = $loc->db_out($pag->setRow("rating" , $i)); //Get this from DB record

			if($maximumul == 0){
				$maximumul = 1;
			}else{
				$maximumul = $maximumul;
			}
			

			
			$rating = ($rat/$maximumul);
			/////////////////END DEBUG SHIT//////////////////

			$nota = $rating*10;
			if($nota < 0){$notar = -1*$nota; $bkg = "red";}
			if($nota == 0){$notar = 10; $bkg = "yellow";}
			if($nota > 0){$notar = $nota; $bkg = "green";}
			?>
			
			<div style="position:absolute; cursor:pointer; left:0px; top:-7px; height:5px; width:<?=($notar*12)+12?>px; background:<?=$bkg?>;" 
			onMouseOver="go_in('<?=$loc->db_out($pag->setRow("filecode" , $i));?>_nota_label');" 
			onMouseOut="go_out('<?=$loc->db_out($pag->setRow("filecode" , $i));?>_nota_label');"
			>
				<div id="<?=$loc->db_out($pag->setRow("filecode" , $i));?>_nota_label" style="position:relative; z-index:100000; display:none; background:#FFFFD2; padding:1px; border:1px solid black; left:0px; top:26px; width:<?=$thumb_size?>px; font-size:11px; color:#808080;">File Rating: <?=number_format($nota,2)?></div>
			</div>

			
			
			
		
			<!-- Delete Icon -->
			<div style="position:absolute; display:<?=$disp?>; background-image:url('images/delete.gif'); width:14px; height:14px; cursor:pointer; left:3px; top:3px;" 
			onMouseOver="go_in('<?=$loc->db_out($pag->setRow("filecode" , $i));?>_rem_label');" 
			onMouseOut="go_out('<?=$loc->db_out($pag->setRow("filecode" , $i));?>_rem_label');" 
			onClick="delete_file('<?=$loc->db_out($pag->setRow("filecode" , $i));?>');" 
			>
				<div id="<?=$loc->db_out($pag->setRow("filecode" , $i));?>_rem_label" style="position:relative; z-index:100000; display:none; background:#FFFFD2; padding:1px; border:1px solid black; left:0px; top:26px; width:150px; font-size:11px; color:#808080;">Delete this file...</div>
			</div>
			


			<!-- Tag Icon -->
			<div style="position:absolute; display:<?=$disp?>; background-image:url('images/tag.gif'); width:13px; height:15px; cursor:pointer; left:18px; top:3px;" 
			onMouseOver="go_in('<?=$loc->db_out($pag->setRow("filecode" , $i));?>_tag_label');" 
			onMouseOut="go_out('<?=$loc->db_out($pag->setRow("filecode" , $i));?>_tag_label');"
			>
				<div id="<?=$loc->db_out($pag->setRow("filecode" , $i));?>_tag_label" style="position:relative; z-index:999999; display:none; background:#FFFFD2; padding:1px; border:1px solid black; left:0px; top:26px; width:140px; font-size:11px; color:#808080;">Modify tags for this file...</div>
			</div>
			

			<!-- This shows in all cases. -->

			<!-- Email Icon -->
			<div style="position:absolute; background-image:url('images/email.gif'); width:15px; height:13px; cursor:pointer; left:<?=$email_left?>px; top:3px;" 
			onMouseOver="go_in('<?=$loc->db_out($pag->setRow("filecode" , $i));?>_email_label');" 
			onMouseOut="go_out('<?=$loc->db_out($pag->setRow("filecode" , $i));?>_email_label');"
			onClick="display_email_dialog('<?=$loc->db_out($pag->setRow("filecode" , $i));?>');"
			>
				<div id="<?=$loc->db_out($pag->setRow("filecode" , $i));?>_email_label" style="position:relative; z-index:999999; display:none; background:#FFFFD2; padding:1px; border:1px solid black; left:0px; top:26px; width:160px; font-size:11px; color:#808080;">Send this file to your friends...</div>
			</div>

			<!-- Email Dialog -->
			<div id="<?=$loc->db_out($pag->setRow("filecode" , $i));?>_email_dialog" style="position:absolute; display:none; z-index:9999599; top:15px; left:-12px; width:550px; height:380px; border:0px solid black; background-image:url('images/email_dialog.png');">

				<!-- The thumbnail of image/file they want to send out -->
				<div style="position:absolute; left:25px; top:35px;">

					<img alt='<?=$loc->db_out($pag->setRow("tags" , $i))?>' 
					src='<?=WEB_ROOT . "download.php?type=thumb&filecode=" . $loc->db_out($pag->setRow("filecode" , $i));?>' 
					style="position:relative; top:-10px;left:-10px;border:1px solid green; cursor:pointer; z-index:1;" 
					onClick="window.open('<?=WEB_ROOT . "download.php?type=temp_thumb&filecode=".$loc->db_out($pag->setRow("filecode" , $i))?>','<?=$loc->db_out($pag->setRow("filecode" , $i))?>','width=<?=$bigImgDat[0]+35?>,height=<?=$bigImgDat[1]+35?>,status=no,toolbar=no,location=yes,menubar=no,directories=no,resizable=yes,scrollbars=yes');" />

				</div>

				<!-- The FileInfo -->
				<div style="position:absolute; font-size:9px; top:22px; left:145px;">
				<?include "image_info.php";?>
				</div>

				<!-- Close button -->
				<div style="position:absolute; top:23px; left:520px; background-image:url('images/close.gif'); width:14px; height:14px; cursor:pointer;"
				onClick="swap('<?=$loc->db_out($pag->setRow("filecode" , $i));?>_email_dialog');"
				></div>

				<!-- The Form -->
				<div style="position:absolute; font-size:9px; top:125px; left:5px;">
				<?include "email_form.php";?>
				</div>

			</div>


			<!-- Voting icons -->

			<!-- Thumbs Up Icon -->
			<div style="position:absolute; background-image:url('images/thumbs_up.png'); width:14px; height:14px; cursor:pointer; left:<?=$thumbs_up_left?>px; top:3px;" 
			onMouseOver="go_in('<?=$loc->db_out($pag->setRow("filecode" , $i));?>_thumbs_up_label');" 
			onMouseOut="go_out('<?=$loc->db_out($pag->setRow("filecode" , $i));?>_thumbs_up_label');"
			onClick="vote('<?=$loc->db_out($pag->setRow("filecode" , $i));?>','up');"
			>
				<div id="<?=$loc->db_out($pag->setRow("filecode" , $i));?>_thumbs_up_label" style="position:relative; z-index:999999; display:none; background:#FFFFD2; padding:1px; border:1px solid black; left:0px; top:26px; width:160px; font-size:11px; color:#808080;">Vote in favour of this file...</div>
			</div>

			<!-- Thumbs Down Icon -->
			<div style="position:absolute; background-image:url('images/thumbs_down.png'); width:14px; height:14px; cursor:pointer; left:<?=$thumbs_down_left?>px; top:3px;" 
			onMouseOver="go_in('<?=$loc->db_out($pag->setRow("filecode" , $i));?>_thumbs_down_label');" 
			onMouseOut="go_out('<?=$loc->db_out($pag->setRow("filecode" , $i));?>_thumbs_down_label');"
			onClick="vote('<?=$loc->db_out($pag->setRow("filecode" , $i));?>','down');"
			>
				<div id="<?=$loc->db_out($pag->setRow("filecode" , $i));?>_thumbs_down_label" style="position:relative; z-index:999999; display:none; background:#FFFFD2; padding:1px; border:1px solid black; left:0px; top:26px; width:160px; font-size:11px; color:#808080;">Vote against this file...</div>
			</div>




		</div>




		<!-- Main small thumbnail display. Including the shadow layers. -->
		<?if($left == 0){$thisLeftHere = $thisLeftHere+5;}else{$hereThisOneLeft = $thisLeftHere;}?>
		<div style='position:absolute; z-index:1; left:<?=$thisLeftHere?>px; top:<?=$thisTopHere?>px;'>
		
		

		<?$fisrtW = $imgDat[0]+3; $firstH = $imgDat[1]-3;?>
		<div style="z-index:1;width:<?=$firstW?>px;height:<?=$firstH?>px;">
		<?$secondW = $imgDat[0]+3; $secondH = $imgDat[1]+3;?>
	   <div style="position:absolute; z-index:1; top:4px; left:4px; background-color:#e6e5e4;width:<?=$secondW?>px;height:<?=$secondH?>px;">
	   <?$thdirdW = $imgDat[0]+2; $thirdH = $imgDat[1]+2;?>
		 <div style="position:absolute; z-index:1;top:1px;left:1px;background-color:#F3F1F1;width:<?=$thirdW?>px;height:<?=$thirdH?>px;">
		 <?$fourthW = $imgDat[0]+1; $fourthH = $imgDat[1]+1;?>
		   <div style="position:absolute; z-index:1;top:1px;left:1px;background-color:#F3F1F1;width:<?=$fourthW?>px;height:<?=$fourthH?>px;">
		   <?$fifthW = $imgDat[0]-3; $fifthH = $imgDat[1]-3;?>
			 <div style="position:absolute; z-index:1;top:2px;left:2px;background-color:#a49f9d;width:<?=$fifthW?>px;height:<?=$fifthH?>px;">



				<div style="position:absolute; z-index:1;">

				

				<img alt='<?=$loc->db_out($pag->setRow("tags" , $i))?>' 
				src='<?=WEB_ROOT . "download.php?type=thumb&filecode=" . $loc->db_out($pag->setRow("filecode" , $i));?>' 
				style="position:relative; top:-10px;left:-10px;border:1px solid green; cursor:pointer; z-index:1;" 
				onMouseOver="document.getElementById('<?=$loc->db_out($pag->setRow("filecode" , $i));?>_info').style.display='block';" 
				onMouseOut="document.getElementById('<?=$loc->db_out($pag->setRow("filecode" , $i));?>_info').style.display='none';" 
				onClick="get_big_image('<?=WEB_ROOT?>' , '<?=$loc->db_out($pag->setRow("filecode" , $i));?>', '<?=$bigImgDat[0]?>', '<?=$bigImgDat[1]?>' , '<?=$top?>');" />

				</div>


			  </div>
			</div>
		  </div>
		</div>
	  </div>


		<!-- Filename display -->
		<?$thisTop = $imgDat[1]+9;?>
		<div style='position:absolute; left:0px; font-size:9px; width:<?=$imgDat[0]?>px; top:<?=$thisTop;?>px;'>
		<center><?php if(strlen($loc->db_out($pag->setRow("filename" , $i)))>13){echo substr($loc->db_out($pag->setRow("filename" , $i)),0,13)."...";}else{echo $loc->db_out($pag->setRow("filename" , $i));}?></center>
		</div>
		
		

		</div>
		<?php

	}else{

		$imgDat = @getimagesize(WEB_ROOT . "images/application.png");

		//if($are_per_row >= PER_ROW){$are_per_row=0; $left = 0; $top = $top+$thumb_size+20; }

		$thisTop = 50;

		$thisLeftHere=$left+((120-48)/2);
		$thisTopHere=$top+((120-48)/2);
		
		?>

		<!-- Display of NON-IMAGE files -->

		<!-- File Info -->
		<div id='<?=$loc->db_out($pag->setRow("filecode" , $i));?>_info' 
		style="position:absolute; padding:5px; left:<?php $thisLeft = $left+120; echo $thisLeft;?>px; top:<?=$top?>px; width:230px; display:none; background:white; color:#000046; z-index:700; font-family:verdana; font-size:10px; border:1px dashed black;">

		<?include "non_image_info.php";?>

		</div>


		<!-- The below icons only appear if a user is loged in and if the current image belongs to him. -->

		<!-- Icons for delete, tag, email, check -->
		<div id="<?=$loc->db_out($pag->setRow("filecode" , $i));?>_image_holder" style="position:absolute; left:<?=$left?>px; top:<?=$thisTopHere-17?>px; border:1px dashed black; width:<?=$thumb_size?>px; height:78px; background:white;">


			<!-- The rating graph -->
					
			<?
			
			$maximumul = $loc->db_out($pag->setRow("total_rates" , $i)); //Get this from DB record
			$rat = $loc->db_out($pag->setRow("rating" , $i)); //Get this from DB record

			if($maximumul == 0){
				$maximumul = 1;
			}else{
				$maximumul = $maximumul;
			}
			

			
			$rating = ($rat/$maximumul);
			/////////////////END DEBUG SHIT//////////////////

			$nota = $rating*10;
			if($nota < 0){$notar = -1*$nota; $bkg = "red";}
			if($nota == 0){$notar = 10; $bkg = "yellow";}
			if($nota > 0){$notar = $nota; $bkg = "green";}
			?>
			
			<div style="position:absolute; cursor:pointer; left:0px; top:-7px; height:5px; width:<?=($notar*12)?>px; background:<?=$bkg?>;" 
			onMouseOver="go_in('<?=$loc->db_out($pag->setRow("filecode" , $i));?>_nota_label');" 
			onMouseOut="go_out('<?=$loc->db_out($pag->setRow("filecode" , $i));?>_nota_label');"
			>
				<div id="<?=$loc->db_out($pag->setRow("filecode" , $i));?>_nota_label" style="position:relative; z-index:100000; display:none; background:#FFFFD2; padding:1px; border:1px solid black; left:0px; top:26px; width:150px; font-size:11px; color:#808080;">File Rating: <?=number_format($nota,2)?></div>
			</div>


		
			<!-- Delete Icon -->
			<div style="position:absolute; display:<?=$disp?>; background-image:url('images/delete.gif'); width:14px; height:14px; cursor:pointer; left:3px; top:2px;" 
			onMouseOver="go_in('<?=$loc->db_out($pag->setRow("filecode" , $i));?>_rem_label');" 
			onMouseOut="go_out('<?=$loc->db_out($pag->setRow("filecode" , $i));?>_rem_label');"
			onClick="delete_file('<?=$loc->db_out($pag->setRow("filecode" , $i));?>');" 
			>
				<div id="<?=$loc->db_out($pag->setRow("filecode" , $i));?>_rem_label" style="position:relative; z-index:100000; display:none; background:#FFFFD2; padding:1px; border:1px solid black; left:0px; top:26px; width:150px; font-size:11px; color:#808080;">Delete this file...</div>
			</div>


			<!-- Tag Icon -->
			<div style="position:absolute; display:<?=$disp?>; background-image:url('images/tag.gif'); width:13px; height:15px; cursor:pointer; left:18px; top:2px;" 
			onMouseOver="go_in('<?=$loc->db_out($pag->setRow("filecode" , $i));?>_tag_label');" 
			onMouseOut="go_out('<?=$loc->db_out($pag->setRow("filecode" , $i));?>_tag_label');"
			>
				<div id="<?=$loc->db_out($pag->setRow("filecode" , $i));?>_tag_label" style="position:relative; z-index:999999; display:none; background:#FFFFD2; padding:1px; border:1px solid black; left:0px; top:26px; width:140px; font-size:11px; color:#808080;">Modify tags for this file...</div>
			</div>
			

			<!-- This shows in all cases. -->

			<!-- Email Icon -->
			<div style="position:absolute; background-image:url('images/email.gif'); width:15px; height:13px; cursor:pointer; left:<?=$email_left?>px; top:2px;" 
			onMouseOver="go_in('<?=$loc->db_out($pag->setRow("filecode" , $i));?>_email_label');" 
			onMouseOut="go_out('<?=$loc->db_out($pag->setRow("filecode" , $i));?>_email_label');"
			onClick="display_email_dialog('<?=$loc->db_out($pag->setRow("filecode" , $i));?>');"
			>
				<div id="<?=$loc->db_out($pag->setRow("filecode" , $i));?>_email_label" style="position:relative; z-index:999999; display:none; background:#FFFFD2; padding:1px; border:1px solid black; left:0px; top:26px; width:160px; font-size:11px; color:#808080;">Send this file to your friends...</div>
			</div>


			<!-- Email Dialog -->
			<div id="<?=$loc->db_out($pag->setRow("filecode" , $i));?>_email_dialog" style="position:absolute; display:none; z-index:9999599; top:15px; left:-12px; width:550px; height:380px; border:0px solid black; background-image:url('images/email_dialog.png');">

				<!-- The thumbnail of image/file they want to send out -->
				<div style="position:absolute; left:25px; top:35px;">

					<img alt='<?=$loc->db_out($pag->setRow("tags" , $i))?>' 
					src='images/application.png' 
					style="position:relative; top:-10px;left:-10px;border:1px solid green; cursor:pointer; z-index:1;" 
					onClick="window.open('<?=WEB_ROOT . "download.php?filecode=".$loc->db_out($pag->setRow("filecode" , $i))?>','<?=$loc->db_out($pag->setRow("filecode" , $i))?>','width=68,height=68,status=no,toolbar=no,location=yes,menubar=no,directories=no,resizable=yes,scrollbars=yes');" />

				</div>

				<!-- The FileInfo -->
				<div style="position:absolute; font-size:9px; top:22px; left:145px;">
				<?include "non_image_info.php";?>
				</div>

				<!-- Close button -->
				<div style="position:absolute; top:23px; left:520px; background-image:url('images/close.gif'); width:14px; height:14px; cursor:pointer;"
				onClick="swap('<?=$loc->db_out($pag->setRow("filecode" , $i));?>_email_dialog');"
				></div>

				<!-- The Form -->
				<div style="position:absolute; font-size:9px; top:125px; left:5px;">
				<?include "email_form.php";?>
				</div>

			</div>


			<!-- Voting icons -->

			<!-- Thumbs Up Icon -->
			<div style="position:absolute; background-image:url('images/thumbs_up.png'); width:14px; height:14px; cursor:pointer; left:<?=$thumbs_up_left?>px; top:3px;" 
			onMouseOver="go_in('<?=$loc->db_out($pag->setRow("filecode" , $i));?>_thumbs_up_label');" 
			onMouseOut="go_out('<?=$loc->db_out($pag->setRow("filecode" , $i));?>_thumbs_up_label');"
			onClick="vote('<?=$loc->db_out($pag->setRow("filecode" , $i));?>','up');"
			>
				<div id="<?=$loc->db_out($pag->setRow("filecode" , $i));?>_thumbs_up_label" style="position:relative; z-index:999999; display:none; background:#FFFFD2; padding:1px; border:1px solid black; left:0px; top:26px; width:160px; font-size:11px; color:#808080;">Vote in favour of this file...</div>
			</div>

			<!-- Thumbs Down Icon -->
			<div style="position:absolute; background-image:url('images/thumbs_down.png'); width:14px; height:14px; cursor:pointer; left:<?=$thumbs_down_left?>px; top:3px;" 
			onMouseOver="go_in('<?=$loc->db_out($pag->setRow("filecode" , $i));?>_thumbs_down_label');" 
			onMouseOut="go_out('<?=$loc->db_out($pag->setRow("filecode" , $i));?>_thumbs_down_label');"
			onClick="vote('<?=$loc->db_out($pag->setRow("filecode" , $i));?>','down');"
			>
				<div id="<?=$loc->db_out($pag->setRow("filecode" , $i));?>_thumbs_down_label" style="position:relative; z-index:999999; display:none; background:#FFFFD2; padding:1px; border:1px solid black; left:0px; top:26px; width:160px; font-size:11px; color:#808080;">Vote against this file...</div>
			</div>




		</div>


		<div style='position:absolute; z-index:1; left:<?=$thisLeftHere?>px; top:<?=$thisTopHere?>px;'
		onMouseOver="document.getElementById('<?=$loc->db_out($pag->setRow("filecode" , $i));?>_info').style.display='block';" 
		onMouseOut="document.getElementById('<?=$loc->db_out($pag->setRow("filecode" , $i));?>_info').style.display='none';">
		

		<a target='_blank' href='download.php?filecode=<?=$loc->db_out($pag->setRow("filecode" , $i))?>'>
		<img alt='<?=$loc->db_out($pag->setRow("tags" , $i))?>' src='images/application.png' style='border-width:0px;' />
		</a>

		<div style='position:absolute; font-size:9px; left:0px; width:<?=$imgDat[0]?>px; top:<?=$thisTop?>"px;'>
		<center><?php if(strlen($loc->db_out($pag->setRow("filename" , $i)))>11){echo substr($loc->db_out($pag->setRow("filename" , $i)),0,11)."...";}else{echo $loc->db_out($pag->setRow("filename" , $i));}?></center>
		</div>
		
		<?php
		echo "</div>";

	}
	
	$are_per_row = $are_per_row + 1;
	//$left = $left + $imgDat[0]+30;
	$left = $left + 120 + 30;

}
echo "</div>";




echo "</div>";

?>